<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ include file="../general/header.jsp" %>
	<div id="globalContainer">
		<div id="editContent">
			<div id="mainContainer">
				<div id="contentCol" class="clearfix">
					<ul class="secciones">
						<li id="editBasicInfoLi" onclick="showTab('editBasicInfo')">
							<a id="basicInfoLink" class="item" href="#" onclick="return false;">Informaci&oacute;n B&aacute;sica</a>
						</li>
						<li id="editProfilePictureLi" onclick="showTab('editProfilePicture')">
							<a id="profilePictureLink" class="item" href="#" onclick="return false;">Foto de Perfil</a>
						</li>
						<li id="editContactInfoLi" onclick="showTab('editContactInfo')">
							<a id="contactInfoLink" class="item" href="#" onclick="return false;">Informaci&oacute;n de Contacto</a>
						</li>
						<li id="editProfessionalInfoLi" onclick="showTab('editProfessionalInfo')">
							<a id="professionalInfoLink" class="item" href="#" onclick="return false;">Informaci&oacute;n Profesional</a>
						</li>
					</ul>
					<div class="clear"></div>
					<div id="contentArea">
						<div class="uiHeader mhl uiHeaderPage">
							<div class="clearfix uiHeaderTop">
								<div class="uiHeaderActions rfloat">
									<a href="../user/viewProfile?userid=${user.id}" title="Se perder&aacute;n los cambios que no hayan sido guardados">Volver al Perfil</a>
								</div>
								<div>
									<h2 class="uiHeaderTitle" tabindex="0">
										${user.name} ${user.lastName}
										<i class="mhs editItemIconsA navArrow"></i>
										Editar Perfil
									</h2>
								</div>
							</div>
						</div>
						<div class="pal grayArea uiBoxGray noborder">
							<div id="editBasicInfo" class="profileFormContainer">
								<form:form class="form" method="POST" action="../user/EditBasicInfo" commandName="BasicInfoForm">
									<div class="form-field">
										<label for="name">Nombre: </label>
										<form:input class="valid" type="text" path="name" />
										<form:errors path="name" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="lastName">Apellido: </label>
										<form:input class="valid" type="text" path="lastName" />
										<form:errors path="lastName" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="birthdate">Fecha de Nacimiento (DD/MM/YYYY): </label>
										<form:input class="valid datepicker" type="text" path="birthdate" />
										<form:errors path="birthdate" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="maritalStatus">Estado Civil: </label>
										<form:select class="valid" path="maritalStatus" >
											<!-- No hace falta ponerle nada al options, spring
											con el uso de reflection y el path e el select, trae
											las opciones automaticamente del enum -->
											<form:options />
										</form:select>
										<form:errors path="maritalStatus" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="gender">G&eacute;nero: </label>
										<form:select class="valid" path="gender" >
											<!-- No hace falta ponerle nada al options, spring
											con el uso de reflection y el path e el select, trae
											las opciones automaticamente del enum -->
											<form:options />
										</form:select>
										<form:errors path="gender" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label></label>
										<a href="../user/UpdatePassword">Actualizar contrase&ntilde;a</a>
									</div>
									<input id="submitBasicInfo" type="submit" value="Guardar" class="boton" />
								</form:form>
							</div>
							<div id="editProfilePicture" class="profileFormContainer">
								<form:form class="form" method="POST" action="../user/EditProfilePicture" commandName="ProfilePictureForm" enctype="multipart/form-data">
									<div class="floatLeft thumbnail">
										<img width="120" height="120" src="./getImage?profileid=${user.profile.id}" />
									</div>
									<div class="floatLeft photoFileBrowser">
										<div id="photoFormLabel"><label class="nowrap thumbnail" for="photo">Seleccionar un archivo de foto de tu computadora (Max. 4Mb):</label></div>
										<div> 
											<form:input class="required floatedLeftInput" type="file" path="photo" />
											<form:errors path="photo" />
										</div>
										<div>
											<a href="../user/DeleteProfilePicture">Eliminar foto</a>
										</div>
									</div>
									<div class="clear"></div>
									<input id="submitProfilePicture" type="submit" value="Guardar" class="boton" />
								</form:form>
							</div>
							<div id="editContactInfo" class="profileFormContainer">
								<form:form class="form" method="POST" action="../user/EditContactInfo" commandName="ContactInfoForm">
									<div class="form-field">
										<label for="phones">Tel&eacute;fonos: </label>
										<form:input class="valid" type="text" path="phones" />
										<form:errors path="phones" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="emails">E-mails: </label>
										<form:input class="valid" type="text" path="emails" />
										<form:errors path="emails" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="address">Direcci&oacute;n: </label>
										<form:input class="valid" type="text" path="address" />
										<form:errors path="address" />
										<div class="clear"></div>
									</div>
									<input id="submitContactInfo" type="submit" value="Guardar" class="boton" />
								</form:form>
							</div>
							<div id="editProfessionalInfo" class="profileFormContainer">
								<form:form class="form" method="POST" action="../user/EditProfessionalInfo" commandName="ProfessionalInfoForm">
									<div class="form-field">
										<label for="title">T&iacute;tulo: </label>
										<form:input class="valid" type="text" path="title" />
										<form:errors path="title" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="extract">Extracto: </label>
										<form:textarea class="valid" cols="60" rows="5" path="extract" />
										<form:errors path="extract" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="education">Eduaci&oacute;n: </label>
										<form:textarea class="valid" cols="60" rows="5" path="education" />
										<form:errors path="education" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="actualjob">Trabajo Actual: </label>
										<form:textarea class="valid" cols="60" rows="5" path="actualjob" />
										<form:errors path="actualjob" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="experience">Experiencia: </label>
										<form:textarea class="valid" cols="60" rows="5" path="experience" />
										<form:errors path="experience" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="knowldege">Conocimientos: </label>
										<form:textarea class="valid" cols="60" rows="5" path="knowldege" />
										<form:errors path="knowldege" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="recommendations">Recomendaciones: </label>
										<form:textarea class="valid" cols="60" rows="5" path="recommendations" />
										<form:errors path="recommendations" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="interests">Intereses: </label>
										<form:textarea class="valid" cols="60" rows="5" path="interests" />
										<form:errors path="interests" />
										<div class="clear"></div>
									</div>
									<div class="form-field">
										<label for="links">Links: </label>
										<form:textarea class="valid" cols="60" rows="5" path="links" />
										<form:errors path="links" />
										<div class="clear"></div>
									</div>									
									<div class="form-field">
										<label for="web">Web: </label>
										<form:input class="valid" type="text" path="web" />
										<form:errors path="web" />
										<div class="clear"></div>
									</div>
									<input id="submitProfessionalInfo" type="submit" value="Guardar" class="boton" />
								</form:form>
							</div>
						</div>
					</div>
				</div>
				<script type="text/javascript" language="javascript">
					//$(document).ready(function(){
						showTab("<c:out value='${tab}' />");
					//})
				</script>
			</div>
		</div>
	</div>
	<%@ include file="../general/footer.jsp" %>